<template>
	<view class="my-search-container" :style="{'background-color': bgColor}" @click="commitSearchClick">
		<view class="my-search-box" :style="{'border-radius': borderRadius + 'px'}">
		  <uni-icons type="search" size="16"></uni-icons>
      <text>搜索</text>
		</view>
	</view>
</template>

<script>
	export default {
    props: {
      // 搜索组件的背景颜色
      bgColor: {
        type: String,
        default: '#ff3f34'
      },
      // 搜索组件的边框圆角
      borderRadius: {
        type: Number,
        default: 18
      }
    },
		data() {
			return {
				
			};
		},
    methods: {
      commitSearchClick() {
        this.$emit('searchClick')
      }
    }
	}
</script>

<style lang="scss">
.my-search-container {
      height: 50px;
      // background-color: #ff3f34;
      display: flex;
      justify-content: center;
      align-items: center;
  .my-search-box {
    width: 95%;
    background-color: #fff;
    padding: 8px 0;
    text-align: center;
    // border-radius: 18px;
    text {
      margin-left: 3px;
    }
  }
 }
</style>
